package com.inibb.app.util.lang;

public class ChineseTranslator {

	/**
	 * To translate Traditional Chinese to Simplified Chinese
	 * @param chtStr - Traditional Chinese in UTF-8 Encoding
	 * @return Simplified Chinese in UTF-8 encoding
	 */
	public static String translateCht2Chs(String chtStr){
		zh = getConvertor();
		return zh.convertString(chtStr, Encoding.UTF8T, Encoding.UTF8S);
	}
	
	private static ZhCodeEncoder zh ;
	
	private static ZhCodeEncoder getConvertor(){
		if(zh!=null){
			return zh;
		}else{
			zh = new ZhCodeEncoder();
			System.out.println("Initialize character library....");
			return zh;
		}
	}

	
}
